package app.mvc.controller.editor
{
	import app.interfaces.IEditorCommand;
	import app.mvc.AppFacade;
	import app.mvc.Notifications;
	import app.mvc.model.VO.UIObjectVO;
	import app.mvc.view.mediators.ObjectsViewMediator;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import utils.UtilsObjects;
	
	public class ClearObjectsCommand extends SimpleCommand implements ICommand
	{
		public function ClearObjectsCommand()
		{
			super();
		}		
		
		override public function execute(notification:INotification):void
		{
			// TODO Auto Generated method stub
			super.execute(notification);
			
			var deletArray:Array = [];
			var allObjects:Vector.<UIObjectVO> =UtilsObjects.uiObjectVOs;
			var len:int = allObjects.length;
			for(var i:int=0;i<len;++i)
			{
				deletArray.push(allObjects[i].uid);
			}
			AppFacade.getInstance().sendNotification(Notifications.CMD_TO_REMOVE_OBJECT,deletArray);
		}
		
	}
}